package com.gs.protobuf.enums;

import lombok.Getter;

/**
 * proto协议枚举类
 * @author guos
 * @date 2025/09/20 14:49
 **/
@Getter
public enum ProtoVersionEnum {


    VERSION_3("v3", "proto3"),
    VERSION_4("v4", "proto4");


    /**
     * 简称
     */
    private final String shortName;

    /**
     * 全称
     */
    private final String fullName;

    ProtoVersionEnum(String shortName, String fullName) {
        this.shortName = shortName;
        this.fullName = fullName;
    }


    /**
     * 根据简称获取全称
     * @param shortName    简称
     * @date 2025/09/20 14:58
     **/
    public static String getFullName(String shortName) {
        for (ProtoVersionEnum versionEnum : ProtoVersionEnum.values()) {
            if (versionEnum.getShortName().equals(shortName)) {
                return versionEnum.getFullName();
            }
        }
        return VERSION_3.fullName;
    }
}
